
#NOTE TO SELF:arrow script and player script:edit for bullet speed/fire button
# ScribbleShooter, based on the script for ZInvaders, by Jeff Mitchell
#

# some images we'll want for the game to use
image-list start
#
# backgrounds
background	apex4832.pcx
background2     apex4932.pcx
background3     apex5032.pcx
background4     apex5132.pcx
background5     apex5232.pcx
background6     apex5332.pcx
#
# enemy chars
enemy1	    ufo1.pcx
ufo2	    ufo1BBR2.pcx
ufo3	    ship_4.pcx
enemy4      ufo5.pcx
enemy5      enemy6.pcx
ufo6        ufo6.pcx
enemy7      giantufo.pcx
#
# bullets
shot1	    shot_2.pcx
#
# explosions
apexboom    zinshee3.pcx
#
#avatars
playeravatar    avatar1.pcx

#
# bombz leftovers in case needed
bluebrick   blbrick.pcx	# basic 16x16 blue floor tile
skeefont    fontaa.pcx
#shot1	    shot1.pcx
person	    perso.pcx
personr	    perso.pcx flipx
decor3	    decor3.pcx
decor3yi    decor3.pcx flipy
bunker1     bunker1.pcx 
#
image-list end


# some audio we'd like to be available
audio-list start
explode	   explode.wav
audio-list end


# define a font we can use for pretty much everything
# Note that "fpsfont" should always be defined as the engine uses it
font		fpsfont
offset_x	1
offset_y	1
char_offset_x	10
kern_offset_x   9
kern_offset_y   11
image		skeefont
charmap		"! #$%&'[]*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz(|)~"
font		end


#
# Define the main script for invader-enemies to use; this is a longish script,
# but should be followable
#
script		invader

// main() is run immediately after script is compiled from config file; used
// only as a way for engine to verify script compiled successfully, though you
// could use it as a place to set variables or the like, since it is only
// ever invoked once *period*. Note that if the script is defined in config
// before something, that something will not be available in the script!
main() {
  // for compile testing
  return ( 6 );

}
  
// mobAI() is invoked if the script is attached to a sprite, and that sprites
// ai is set to mob_script
public mobAI () {
  new id = mob_this();
  new dir;
  new speed = 1;
  new kills;

  // pick up some variables
  dir = global_get ( "direction" );
  kills = global_get ( "kills" );

  // speed up ufo's as more kills rack up
  speed = 25 + ( kills / 2 );

  // try and move invader in the appropriate direction, left or right
  if ( dir == 1 ) {
    mob_move ( id, dirRight, speed );
    if ( last_block_type() == blockImpassable ) {
      global_set ( "direction", 0 );
    }
  } else {
    mob_move ( id, dirLeft, speed );
    if ( last_block_type() == blockImpassable ) {
      global_set ( "direction", 1 );
    }
  }

  // if they ran into something, they have to move down..
  if ( last_block_type() == blockImpassable ) {
    moveAllInvaders ( dirDown, 10 );
  } // if was blocked

  // about to kill the player?
  if ( mob_get_y ( id ) > 240  ) {
    new pk = player_mob_id();
    // kill player!
    mob_kill ( pk );
    // move them up a bit, so player doesn't get killed again,
    // and it looks cool..
    moveAllInvaders ( dirUp, 20 );
  }

  return ( 0 );
}

moveAllInvaders ( direction, distance ) {
  new id, last;

  // find the first mob
  id = mob_first ( 4 );
  last = mob_last ( 4 );

  // while not done mobs
  while ( id ) {

    // move it down
    mob_move ( id, direction, distance );

    // is this the last one in that priority? if so, stop
    if ( id == last ) {
      break;
    }

    // go onto the next mob.. maybe last one
    id = mob_after ( id );

  } // for each mob

  return;
}

script		end


script		player

// main() is run immediately after script is compiled from config file; used
// only as a way for engine to verify script compiled successfully, though you
// could use it as a place to set variables or the like, since it is only
// ever invoked once *period*. Note that if the script is defined in config
// before something, that something will not be available in the script!
main() {
  // for compile testing
  return ( 19 );
}

public playerAI () {
  // pick up player ID
  new p = player_mob_id();

  // check for player left/right buttons, and move him
  if ( player_key_left() ) {
    mob_move ( p, dirLeft, 3 );
  } else if ( player_key_right() ) {
    mob_move ( p, dirRight, 3 );
  }
   //check for up/down, move
    if(player_key_up()) {
    mob_move ( p, dirUp, 2);
} else if (player_key_down()) {
mob_move ( p, dirDown, 4);
 } 

  // is he firing? if so, create a new mob
  if ( player_key_fire1() ) {
    new t = ticks();
    // prevent firing too quickly
    if ( t - global_get ( "last_fire" ) > 200 ) {
      mob_make ( "arrow", mob_get_x ( p ), mob_get_y ( p ) - 10 );
      global_set ( "last_fire", t );
    }
  }

}

script		end



script		arrow

// main() is run immediately after script is compiled from config file; used
// only as a way for engine to verify script compiled successfully, though you
// could use it as a place to set variables or the like, since it is only
// ever invoked once *period*. Note that if the script is defined in config
// before something, that something will not be available in the script!
main() {
  // for compile testing
  return ( 19 );
}

// mobAI() is invoked if the script is attached to a sprite, and that sprites
// ai is set to mob_script
public mobAI () {
  new id = mob_this();

  mob_move ( id, dirUp, 10 );

  // if shot hits an invader, kill it and the invader off
  if ( last_block_type() == blockMobile ) {
    new nme = mob_that();		// who we ran into
    new nmex = mob_get_x ( nme );	// where is he?
    new nmey = mob_get_y ( nme );	// where is he?

    // kill enemy ufo just ran into
    mob_kill ( nme );

    // make an explosion artwork
    mob_make ( "ufo_death", nmex - 10, nmey - 10 );

    // increment kill counter, so aliens can speed up!
    global_set ( "kills", global_get ( "kills" ) + 1 );


  
    // reset timer so player can fire again immediately
    global_set ( "last_fire", 0 );
   
    // play audio
    new aid = audio_get_id ( "explode" );
    if ( aid ) {
      audio_play ( aid );
    }
    return ( 1 );
  }

  // if shot goes up past invaders, kill it off
  if ( mob_get_y ( id ) < 25 ) {
    mob_kill ( id );
  }

  return ( 0 );
}

script		end




script		LevelScript

// main() is run immediately after script is compiled from config file; used
// only as a way for engine to verify script compiled successfully, though you
// could use it as a place to set variables or the like, since it is only
// ever invoked once *period*. Note that if the script is defined in config
// before something, that something will not be available in the script!
main() {
  // for compile testing
  return ( 19 );
}

// reset level is an optional function; it is only called if you have a tilemap
// that has this script attached ("script some_script_name" in the tilemap
// part of the config). When called, the built-in Zot reset-level is not used,
// so you'll have to do your own kill-all-sprites, pop-new-sprites and moving
// player to some starting location, if you want to.
//   This is an ideal place to put pre-level settings, sprite popping, etc.
public resetLevel() {

  // set up default direction for invaders to move
  global_set ( "direction", 1 );


  // move player to starting location
  new p;
  p = player_mob_id();
  mob_set_xy ( p, tile_to_px(15), tile_to_px(17) );

  // kill all existing invaders (in case this is after player death..)
  new id = mob_first ( 4 );
  new last = mob_last ( 4 );

  // while not done mobs
  while ( id ) {

    mob_kill ( id );

    if ( id == last ) {
      break;
    }

    // go onto the next mob.. maybe last one
    id = mob_after ( id );

  } // for each mob

  // make some invaders for player to fight!
  new i;
  new y = 20;

  for ( i = 0; i < 6; i++ ) {
      new x;
      x = 15 + ( i % 6 ) * 70;
      mob_make ( "ufo", x, y + ( i / 6 ) * 25 );
  }

  y += 75;

  for ( i = 0; i < 12; i++ ) {
      new x;
      x = 35 + ( i % 6 ) * 70;
      mob_make ( "ufo2", x, y + ( i / 6 ) * 25 );
  }

  y += 50;

  for ( i = 0; i < 6; i++ ) {
      new x;
      x = 35 + ( i % 6 ) * 70;
      mob_make ( "ufo3", x, y );
  }

}

script		end

script		LevelScript2

// main() is run immediately after script is compiled from config file; used
// only as a way for engine to verify script compiled successfully, though you
// could use it as a place to set variables or the like, since it is only
// ever invoked once *period*. Note that if the script is defined in config
// before something, that something will not be available in the script!
main() {
  // for compile testing
  return ( 19 );
}

// reset level is an optional function; it is only called if you have a tilemap
// that has this script attached ("script some_script_name" in the tilemap
// part of the config). When called, the built-in Zot reset-level is not used,
// so you'll have to do your own kill-all-sprites, pop-new-sprites and moving
// player to some starting location, if you want to.
//   This is an ideal place to put pre-level settings, sprite popping, etc.
public resetLevel() {

  // set up default direction for invaders to move
  global_set ( "direction", 1 );


  // move player to starting location
  new p;
  p = player_mob_id();
  mob_set_xy ( p, tile_to_px(15), tile_to_px(17) );

  // kill all existing invaders (in case this is after player death..)
  new id = mob_first ( 4 );
  new last = mob_last ( 4 );

  // while not done mobs
  while ( id ) {

    mob_kill ( id );

    if ( id == last ) {
      break;
    }

    // go onto the next mob.. maybe last one
    id = mob_after ( id );

  } // for each mob

  // make some invaders for player to fight!
  new i;
  new y = 20;

  for ( i = 0; i < 6; i++ ) {
      new x;
      x = 15 + ( i % 6 ) * 70;
      mob_make ( "ufo", x, y + ( i / 6 ) * 25 );
  }

  y += 75;

  for ( i = 0; i < 7; i++ ) {
      new x;
      x = 35 + ( i % 6 ) * 70;
      mob_make ( "ufo6", x, y + ( i / 6 ) * 25 );
  }

  y += 50;

  for ( i = 0; i < 8; i++ ) {
      new x;
      x = 35 + ( i % 6 ) * 70;
      mob_make ( "ufo3", x, y );
  }

}

script		end



sprite		arrow
name		bullet
option		airborne
option		impassable
ai		mob_script arrow
#ai		mob_arrow	    # the AI to use
speed		50000000000
width		18
height		31
image_width	18
image_height	31
order		4	    # order is 1..3 (start at 1, 3 is drawn last)
anim_statedef	still	    # animation state 1; 1..n (start at 1)
anim_steps	1	    # 7 artworks in pcx file
anim_image	shot1       # use this image for animating this state
sprite		end



sprite		player
name		player
ai		mob_script player
#ai		player
speed		5	    # player moves twice as often as everything else!
option          velocity
option		impassable
#option          velocity
# render order (1 is first, 3 is last)
order		5
leaving		60
# location of body within sprite
width		16
height		13
offset_y	9
# artwork for sprite
image_width	16
image_height	24
# while standing still
anim_statedef     still 
anim_steps	1
anim_offset_x	16
anim_image	person
#
sprite		end



sprite		ufo
name		ufo
order		4	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		1
#option         velocity
option		impassable
# AI details
#ai		mob_bounce    # the AI to use
ai		mob_bounce  invader
#ainear		mob_bounce  # the AI to use when player is "near"
near		1	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	40
image_height	18
width		40
height		18
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image	enemy1        # use this image for animating this state
#
sprite		end



sprite		ufo2
name		ufo
order		3	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		1
option		impassable
# AI details
#ai		mob_flee    # the AI to use
ai		mob_flee    invader
#ainear		mob_robotron  # the AI to use when player is "near"
near		4	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	25
image_height	25
width		25
height		25
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image	ufo2        # use this image for animating this state
#
sprite		end




sprite		ufo3
name		ufo
order		2	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		1
#option         velocity
option		impassable
# AI details
#ai		mob_flee    # the AI to use
ai		mob_flee    invader
#ainear		mob_robotron  # the AI to use when player is "near"
near		4	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	22
image_height	30
width		22
height		30
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image	ufo3        # use this image for animating this state
#
sprite		end


sprite		enemy4
name		ufo
order		3	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		1
#option         velocity
option		impassable
# AI details
#ai		mob_flee    # the AI to use
ai		mob_flee    invader
#ainear		mob_robotron  # the AI to use when player is "near"
near		2	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	25
image_height	25
width		25
height		25
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image	enemy4        # use this image for animating this state
#
sprite		end


sprite		enemy5
name		ufo
order		3	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		90000000
#option         velocity
option		impassable
# AI details
#ai		mob_bounce    # the AI to use
ai		mob_robotron   invader
#ainear		mob_robotron  # the AI to use when player is "near"
near		2	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	35
image_height	35
width		35
height		35
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image	enemy5        # use this image for animating this state
#
sprite		end


sprite		ufo6
name		ufo
order		1	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		5000
#option         velocity
option		impassable
# AI details
#ai		mob_flee    # the AI to use
ai		mob_flee    invader
#ainear		mob_robotron  # the AI to use when player is "near"
near		4	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	35
image_height	35
width		35
height		35
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image	ufo6        # use this image for animating this state
#
sprite		end


sprite		giantufo
name		ufo
order		1	    # spr. order is 1..3 (start at 1, 3 is drawn last)
speed		5000
#option         velocity
option		impassable
# AI details
#ai		mob_robotron    # the AI to use
ai		mob_robotron    invader
#ainear		mob_robotron  # the AI to use when player is "near"
near		4	    # 7 tiles away is "near"
# dimensions; artwork dimensions and sprite body dimensions!
image_width	135
image_height	135
width		135
height		135
#
# while standing still
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	1	    # 7 artworks in pcx file
anim_shift_x	0
anim_offset_x	0	    # artwork is 25px offset from last step
anim_image      enemy7        # use this image for animating this state
#
sprite		end

sprite		ufo_death   # call this ufo*death to make it automatic
name		mobdeath
order		4	    # spr. order is 1..3 (start at 1, 3 is drawn last)
#option         velocity
option		indestructable
ai		mob_animonce
image_width	60
image_height	60
width		60
height		60
anim_statedef	still	    # if engine needs a missing state, first state used
anim_steps	7 once	    # 7 artworks in pcx file
anim_offset_x	60
anim_image	apexboom  # use this image for animating this state
sprite		end


#
#
#
# which floor are we starting on in this level?
startmap        Level7

# post intro messages
post-message    "ScribbleShooter coded for GBAX2005"
post-message     "by AJ Ortiz,based on ZInvaders by"
post-message      "Jeff Mitchell"



# define the tiles for use on floors in this config
#
tile	   	@
name		floorstart
image		background
#image		tileblack
option		starthere
tile		end

tile		W
name		wall
image		tileblack
option		impassable
tile		end

#
# make up a floor based on all those tiles
#

tilemap		Level1

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background
option		autotile
tile		end

width		32
height		22
script		LevelScript
row		WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row		W.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^@^^^^^^^^^^^^^^^^^W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row		WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
tilemap		end

#level 2

tilemap		Level2

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background3
option		autotile
tile		end

width		30
height		26
script		LevelScript
row		WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row		W.<<<<<<<<<<<<<<<<<<<<<<<<<<<W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^@^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		W^^^^^^^^^^^^^^^^^^^^^^^^^<<<W
row		WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
tilemap		end

tilemap Level3

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background2
option		autotile
tile		end
    Width 30
    Height 23
 Script  LevelScript

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^@^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end


tilemap Level4

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background3
option		autotile
tile		end

tile            /
name            bunker
image           bunker1
option    impassable_left
option    impassable_right
tile            end

    Width 30
    Height 23
 Script  LevelScript

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^/^^^^^^^^^^^^^/^^^^^^^^W
row             W^^^^^/^^^^^^^^^^^^^/^^^^^^^^W                  
row             W^^^^^////^^^^^^^////^^^^^^^^W                  
row             W^^^^^<<<<^^^^^^^<<<<^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^@^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end

tilemap Level5

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background4
option		autotile
tile		end


tile            /
name            bunker
image           bunker1
option        impassable_right
option        impassable_left
tile            end


    Width 30
    Height 23
 Script  LevelScript

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^///////^^^^//////^^^^W                  
row             W^^^^^^^<<<<<<<^^^<<<<<<<^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^@^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end

tilemap Level6

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background
option		autotile
tile		end


tile            /
name            bunker
image           bunker1
option        impassable_right
option        impassable_left
tile            end


    Width 30
    Height 23
 Script  LevelScript

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^//^^^^^^^^^^//^^^^^W
row             W^^^^^^^//<<^^^^^^^^^<<//^^^^W                  
row             W^^^^^^^<<<<^^^^^^^^^^^<<^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^@^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end



tilemap Level7

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background2
option		autotile
tile		end


tile            /
name            bunker
image           bunker1
option        impassable_right
option        impassable_left
tile            end

    Width 30
    Height 23
 Script  LevelScript2

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^//^^^^^^//////^^^^^W
row             W^^^^/////<<^^^^^<<<<<<//^^^^W                  
row             W^^^<<<<<<<<^^^^^^^^^^^<<^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^@^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end


tilemap Level8

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background5
option		autotile
tile		end


tile            /
name            bunker
image           bunker1
option        impassable_right
option        impassable_left
tile            end

    Width 30
    Height 22
 Script  LevelScript2

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<W                  
row             W^^^^^^^^^//^^^^^^//////^^^^^W
row             W^^^^/////<<^^^^^<<<<<<//^^^^W                  
row             W^^^<<<<<<<<^^^^^^^^^^^<<^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^/////////////^^^^^^^^W
row             W^^^^^^<<<<<<<<<<<<<<^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^@^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end



tilemap Level8

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background3
option		autotile
tile		end


tile            /
name            bunker
image           bunker1
option        impassable_right
option        impassable_left
tile            end

    Width 30
    Height 22
 Script  LevelScript2

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<W                  
row             W^^^^^^^^^//^^^^^^//////^^^^^W
row             W^^^^/////<<^^^^^<<<<<<//^^^^W                  
row             W^^^<<<<<<<<^^^^^^^^^^^<<^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^/////^^^^////^^^^^^^^W
row             W^^^^^^<<<<<<^^^^<<<<^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^///^^^^^^^^^^^^^^^^^///^^^W
row             W^^<<<^^^^^^^^^^^^^^^^^<<<^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^@^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end


tilemap Level9

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background2
option		autotile
tile		end


tile            /
name            bunker
image           bunker1
option        impassable_right
option        impassable_left
tile            end

    Width 35
    Height 25
 Script  LevelScript2

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^/////^^^^^^^^^^^^^/////^^^^^W
row             W^^^^<<<<<<^^^^^^^^^^^^<<<<<<^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^///^^^^^^^^^^^^^^^^^^^^^^^///^^W
row             W^<<<<^^^^^^^^^^^^^^^^^^^^^^<<<<^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^/////^^^^^^^^/////^^^^^^^^W
row             W^^^^^^<<<<<<^^^^^^^<<<<<<^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^@^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end


tilemap Level10

# this is a private-tile, only available to this floor, since it was
# declared within the tilemap
tile	   	.
name		floor
image		background6
option		autotile
tile		end


tile            /
name            bunker
image           bunker1
option        impassable_right
option        impassable_left
tile            end

    Width 35
    Height 29
 Script  LevelScript

row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
row             W.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W                  
row             W^^^^^/////^^^^^^^^^^^^^/////^^^^^W
row             W^^^^<<<<<<^^^^^^^^^^^^<<<<<<^^^^^W                  
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^///^^^^^^^^^^^^^^^^^^^^^^^///^^W
row             W^<<<<^^^^^^^^^^^^^^^^^^^^^^<<<<^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^/////^^^^^^^^/////^^^^^^^^W
row             W^^^^^^<<<<<<^^^^^^^<<<<<<^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^///////^^^^^^^^^^^^^//////^^W
row             W^^^^<<<<<<<<^^^^^^^^^^^^<<<<<<<^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^@^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             W^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^W
row             WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 tilemap   end

#############add triggers and other stuff here...


#first level dialog
text-menu       1
avatar-image	playeravatar
avatar-name	player
preamble	"Where am I, what's going on?  ...What are all these things...?......Wait a second, huh? paper, AHHHHH, we have to shoot them ALL, no exceptions. I am fighting for GBAX 2005 coding competition!"
"Lets Go!" end-dialog 
text-menu	end



trigger *
on-floor Level1 player
action goto-text 1
trigger end

####change velocity for level 1
  action-group 1
   variable-set _player_movevelocity 10
   variable-set _player_jumpvelocity 200
    action-group end   
 
  
     trigger *
     on-floor Level1 player
     action action-group 1
     trigger end

#####change level
    trigger *
    on-floor Level1
    on-no-sprite  Level1  ufo
    action goto-floor level2
     trigger end 
       
###change level    
   trigger *
  on-floor Level2
   on-no-sprite  Level2 ufo
   action goto-floor level3
   trigger end

###make a new enemy
     
trigger *
  on-floor Level2  player 
 action make-sprite enemy4 9,20
  trigger end    

 ###change velocity, make new enemies (currently on level 3)
action-group 2
variable-set _player_movevelocity 45
variable-set _player_jumpvelocity 225
make-sprite ufo6 9,20
make-sprite enemy4 10,20
make-sprite ufo6 15,20
action-group end

trigger *
  on-floor Level3   player
  action action-group 2
  trigger end

  trigger *
 when-dies enemy4
 action make-sprite enemy5 10,22
  trigger end
  
####change to level 4
trigger * 
 on-floor Level3 player
 on-no-sprite Level3 ufo
 action goto-floor Level4
trigger end


####speed up velocity (again), and make more new enemies
action-group 3

variable-set _player_movevelocity 6500
variable-set _player_jumpvelocity 50000
make-sprite ufo6  10,20
make-sprite enemy4 5,21
action-group end

 trigger *
 on-floor Level4 player
 action      action-group 3
 trigger end


#########change to level 5
action-group  4
goto-floor Level5
post-message "You're halfway done!"
action-group    end

trigger *
on-floor Level4 player
on-no-sprite Level4 ufo
action   action-group 4
trigger end

#######change to l.6
trigger *
on-floor Level5 player
on-no-sprite Level5 ufo
action   goto-floor Level6
trigger end

######add a bunch of enemies
action-group 5
make-sprite ufo6 10,20
make-sprite ufo6 15,20
make-sprite ufo6 20,20
make-sprite enemy4 10,15
action-group end

trigger *
on-floor Level6 player
action        action-group 5
trigger end

####change to level 7
trigger  *
on-floor Level6 player
on-no-sprite Level5 ufo
action goto-floor Level7
trigger end

####change to level 8 make LOTS of enemies
action-group 6
make-sprite ufo3  6,4
make-sprite ufo6  5,16
make-sprite ufo6  10,16
action-group end

trigger *
on-floor Level7 player
on-no-sprite Level7 ufo
action goto-floor Level8 player
trigger end

trigger *
on-floor Level8 player
action action-group 6 
trigger end

####change to level 9, make "GiantUFO"
trigger *
on-floor Level8 player
on-no-sprite Level8 ufo
action goto-floor Level9 player
trigger end

action-group 7

make-sprite giantufo 5,20
make-sprite giantufo 15,20
make-sprite  ufo6    12,10
action-group end

trigger *
on-floor Level9 player
action action-group 7
trigger end


####change to level 10, post message, make enemies, etc...
action-group 8
post-message "Last level!"
make-sprite  ufo6  5,20
make-sprite  ufo6  10,25
make-sprite  enemy4 20,25
make-sprite  enemy4 5,24
make-sprite  enemy4 10,24
make-sprite  giantufo 10,20
make-sprite  ufo3     15,15
action-group end

trigger *
on-floor Level9 player
on-no-sprite Level9 ufo
action goto-floor Level10 player
trigger end

trigger *
on-floor Level10 player
action   action-group 8
trigger end

##########make a level select menu after game is beaten

text-menu 2
avatar-image playeravatar
avatar-name  player
preamble  "Well, you've beaten the current build, now you have to go to http://emuholic.emuboards.com!. Do you want to play again?"
"yes"  goto-floor Level1
"no"   end-dialog
text-menu end


action-group 9
post-message "You've beaten the game!"
post-message "The current build is only"
post-message "10 levels, but the upcoming"
post-message "version will have 20 or 30"
post-message "Check hiddengamer.tk for updates"
post-message "Email me:skate2live92@netscape.net"
goto-text 2
action-group end

trigger *
on-floor Level10 player
on-no-sprite Level10 ufo
action action-group 9
trigger end




